<template>
  <div ref="dashboard" style="width: 600px;height:400px;"></div>
</template>

<script lang="ts" setup>
import * as echarts from 'echarts';
import {onMounted, ref} from "vue";

const dashboard = ref()

onMounted(() => {
  // 基于准备好的dom，初始化echarts实例
  const myChart = echarts.init(dashboard.value);
// 绘制图表
  myChart.setOption({
    // 图标标题
    title: {
      text: 'ECharts 入门示例'
    },
    // 鼠标悬浮或划过时的弹出的提示框
    tooltip: {},
    // X 轴坐标值
    xAxis: {
      data: ['衬衫', '羊毛衫', '雪纺衫', '裤子', '高跟鞋', '袜子']
    },
    // Y 轴坐标值
    yAxis: {},
    // series 中存放页面要展示的数据
    series: [
      {
        name: '销量',
        type: 'bar',
        data: [5, 20, 36, 10, 10, 20]
      }
    ]
  });
})

</script>

<style lang="less" scoped>

</style>